package net.loyintean.pearlshell.base.model.impl;

import java.io.Serializable;

import net.loyintean.pearlshell.base.model.ICodeText;

/**
 * provides an implement for {@link ICodeText}
 * 
 * @author Loy
 * @version 2014-7-9.1.0.0
 */
public class CodeTextModel implements Serializable, ICodeText {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6749095767267820490L;

	/**
	 * the code
	 * 
	 */
	private String code;

	/**
	 * the text
	 * 
	 */
	private String text;

	/**
	 * the construct with code and text.
	 * 
	 * @author Loy
	 * @param c
	 *            {@link #code}
	 * @param t
	 *            {@link #text}
	 */
	public CodeTextModel(String c, String t) {
		super();
		this.code = c;
		this.text = t;
	}

	/**
	 * 
	 * @author Loy
	 * @see net.loyintean.pearlshell.base.model.ICodeText #getCode()
	 * 
	 */
	@Override
	public String getCode() {
		return code;
	}

	/**
	 * 
	 * @author Loy
	 * @see net.loyintean.pearlshell.base.model.ICodeText
	 *      #setCode(java.lang.String)
	 * 
	 */
	@Override
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * 
	 * @author Loy
	 * @see net.loyintean.pearlshell.base.model.ICodeText #getText()
	 * 
	 */
	@Override
	public String getText() {
		return text;
	}

	/**
	 * 
	 * @author Loy
	 * @see net.loyintean.pearlshell.base.model.ICodeText
	 *      #setText(java.lang.String)
	 * 
	 */
	@Override
	public void setText(String text) {
		this.text = text;
	}

	/**
	 * output field values.
	 * 
	 * @author Loy
	 * @see java.lang.Object#toString()
	 * 
	 */
	@Override
	public String toString() {
		return "CodeTextModel [" + (code != null ? "code=" + code + ", " : "")
				+ (text != null ? "text=" + text : "") + "]";
	}
}
